package com.yami.shop.bean.app.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * 人脸设计配置DTO
 * @author AI Assistant
 */
@Data
@Schema(description = "人脸设计配置")
public class FaceDesignConfigDto {

    @Schema(description = "人脸底图配置")
    private FaceBaseConfig faceBase;

    @Schema(description = "五官配置列表")
    private List<FeatureConfigItem> features;

    @Schema(description = "画布配置")
    private CanvasConfig canvas;

    @Schema(description = "设计稿元数据")
    private DesignMetadata metadata;

    /**
     * 人脸底图配置
     */
    @Data
    @Schema(description = "人脸底图配置")
    public static class FaceBaseConfig {

        @Schema(description = "人脸底图ID")
        private Long faceBaseId;

        @Schema(description = "人脸底图名称")
        private String faceName;

        @Schema(description = "人脸底图URL")
        private String imageUrl;

        @Schema(description = "人脸类型")
        private Integer faceType;

        @Schema(description = "缩放比例")
        private Double scale;

        @Schema(description = "X轴偏移量")
        private Integer offsetX;

        @Schema(description = "Y轴偏移量")
        private Integer offsetY;

        @Schema(description = "旋转角度")
        private Double rotation;
    }

    /**
     * 五官配置项
     */
    @Data
    @Schema(description = "五官配置项")
    public static class FeatureConfigItem {



        @Schema(description = "五官资源ID")
        private Long featureId;

        @Schema(description = "五官资源名称")
        private String featureName;

        @Schema(description = "五官类型 1:眼睛 2:眉毛 3:鼻子 4:嘴巴 5:腮红 6:发型")
        private Integer featureType;

        @Schema(description = "图片URL")
        private String imageUrl;

        @Schema(description = "X轴偏移量")
        private Integer offsetX;

        @Schema(description = "Y轴偏移量")
        private Integer offsetY;

        @Schema(description = "缩放比例")
        private Double scale;

        @Schema(description = "旋转角度")
        private Double rotation;

        @Schema(description = "图层顺序（数值越大越靠上）")
        private Integer layerOrder;

        @Schema(description = "是否可见")
        private Boolean visible;

        @Schema(description = "透明度（0-1）")
        private Double opacity;

        @Schema(description = "混合模式")
        private String blendMode;

        @Schema(description = "滤镜效果")
        private FilterEffect filter;
    }

    /**
     * 画布配置
     */
    @Data
    @Schema(description = "画布配置")
    public static class CanvasConfig {

        @Schema(description = "画布宽度")
        private Integer width;

        @Schema(description = "画布高度")
        private Integer height;

        @Schema(description = "背景颜色")
        private String backgroundColor;

        @Schema(description = "背景图片URL")
        private String backgroundImage;

        @Schema(description = "画布缩放比例")
        private Double zoom;

        @Schema(description = "画布偏移X")
        private Integer panX;

        @Schema(description = "画布偏移Y")
        private Integer panY;
    }

    /**
     * 设计稿元数据
     */
    @Data
    @Schema(description = "设计稿元数据")
    public static class DesignMetadata {

        @Schema(description = "版本号")
        private String version;

        @Schema(description = "创建时间")
        private String createTime;

        @Schema(description = "最后修改时间")
        private String lastModified;

        @Schema(description = "作者")
        private String author;

        @Schema(description = "标签列表")
        private List<String> tags;

        @Schema(description = "描述")
        private String description;

        @Schema(description = "缩略图URL")
        private String thumbnailUrl;
    }

    /**
     * 滤镜效果
     */
    @Data
    @Schema(description = "滤镜效果")
    public static class FilterEffect {

        @Schema(description = "亮度（-100到100）")
        private Integer brightness;

        @Schema(description = "对比度（-100到100）")
        private Integer contrast;

        @Schema(description = "饱和度（-100到100）")
        private Integer saturation;

        @Schema(description = "色相（0-360）")
        private Integer hue;

        @Schema(description = "模糊度（0-100）")
        private Integer blur;

        @Schema(description = "是否灰度")
        private Boolean grayscale;

        @Schema(description = "是否反色")
        private Boolean invert;
    }
}
